package com.example.alee.ALeeSpringWeb.config;

import com.example.alee.ALeeSpringWeb.bean.User;
import com.example.alee.ALeeSpringWeb.service.MyServer;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.ConfigurationPropertiesScan;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.Arrays;
import java.util.List;
import java.util.Map;

@ConfigurationProperties(prefix = "str-list-map")
public class CollectionConfig {
    private List<MyServer> serverList;
    private Map<String, User> userMap;
    private String[] names;

    public List<MyServer> getServerList() {
        return serverList;
    }

    public void setServerList(List<MyServer> serverList) {
        this.serverList = serverList;
    }

    public Map<String, User> getUserMap() {
        return userMap;
    }

    public void setUserMap(Map<String, User> userMap) {
        this.userMap = userMap;
    }

    public String[] getNames() {
        return names;
    }

    public void setNames(String[] names) {
        this.names = names;
    }

    @Override
    public String toString() {
        return "CollectionConfig{" +
                "serverList=" + serverList + serverList.size() +
                ", userMap=" + userMap + userMap.size() +
                ", names=" + Arrays.toString(names) + names.length +
                '}';
    }
}
